<?php
 /*
 * 1626cms ajax返回
 * ============================================================================
 * 版權所有: 1626網絡，并保留所有權利。
 * 網站地址: http://www.1626.com；
 * ----------------------------------------------------------------------------
 * 這不是一個自由軟件！您只能在不用于商業目的的前提下對程序代碼進行修改和
 * 使用；不允許對程序代碼以任何形式任何目的的再發布。
 * ============================================================================
*/
define('IN_QISHI', true);
require_once('../data/config.php');
require_once('./include/admin_common.inc.php');
$act = !empty($_GET['act']) ? trim($_GET['act']) : 'category_list';
if($act == 'category_list'){
$category_id=trim($_GET['category_id']);
$last=trim($_GET['last']);
($category_id+0)>0?'':die('參數錯誤！');
require_once(ADMIN_ROOT_PATH.'include/admin_settings_category_fun.php');
$category_list=get_jobs_Parent_list($category_id);
$category_num=count($category_list); 
for($i=0;$i<$category_num;$i++){ 
echo "<div class=\"jobs_category_box_leftimg\">";
if ($last<>$category_list[$i]['ParentID'])
{
echo "<img src=\"images/category_list_center/plus1.gif\" width=\"30\" height=\"30\" align=\"absmiddle\" />";
}
echo "&nbsp;</div>";
echo "<div class=\"jobs_category_box_center\">&nbsp;&nbsp;&nbsp;&nbsp;";
if ($category_num==($i+1))
{
echo "<img src=\"images/category_list_center/nofollow2.gif\" width=\"30\" height=\"30\" align=\"absmiddle\" />";
}
else
{
echo "<img src=\"images/category_list_center/nofollow1.gif\" width=\"30\" height=\"30\" align=\"absmiddle\" />";
}
echo "<input name=\"categoryname[]\" type=\"text\" class=\"article_category_input_a\"  onfocus=\"this.className='article_category_input_c'\"   onblur=\"this.className='article_category_input_a'\" value=\"".$category_list[$i]['categoryname']."\" maxlength=\"20\" style=\" width:178px;\"/>";
echo "<span style=\"color:#666666; font-size:10px;\">&nbsp;(id:".$category_list[$i]['id'].")</span>";
echo "<input name=\"y_id[]\" type=\"checkbox\" id=\"y_id[]\" value=\"".$category_list[$i]['id']."\" checked=\"checked\" / style=\"display:none\" />";
echo "</div>";
echo "<div class=\"jobs_category_box_right\">";
echo "排序: ";
echo "<input name=\"category_order[]\" type=\"text\" class=\"article_category_input_a\" style=\"width:30px; font-size:12px;\"  onfocus=\"this.className='article_category_input_c'\"   onblur=\"this.className='article_category_input_a'\"  onkeyup=\"if(event.keyCode !=37 && event.keyCode != 39) value=value.replace(/\D/g,'');\" value=\"".$category_list[$i]['category_order']."\" maxlength=\"3\" onbeforepaste=\"clipboardData.setData('text',clipboardData.getData('text').replace(/\D/g,''))\"/>";
echo "&nbsp;&nbsp;<a href=\"?act=edit_category&y_id=".$category_list[$i]['id']."\">修改</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onClick=\"return confirm('確定要刪除嗎？')\" href=\"?act=del_category&y_id=".$category_list[$i]['id']."\">刪除</a>";
echo "</div>";
}
echo "<div class=\"clear\"></div>";
}
if($act == 'edit_payment_listorder')
{
require_once(ADMIN_ROOT_PATH.'include/admin_payment_fun.php');
$id=trim($_GET['id']);
$eid=trim($_GET['eid']);
edit_payment_listorder($id,$eid);
}
//修改職位，通過AJAX獲取職位分類
if($act == 'editjobs_category_list'){//企業會員發招聘，獲取小類
$category_id=trim($_GET['category_id']);
if (($category_id+0)>0 && intval($category_id)==$category_id)
{
require_once(ADMIN_ROOT_PATH.'include/admin_fun_category.php');
$category_list=get_jobs_Parent_list($category_id);
echo "<select name=\"subclass\" style=\"width:210px; height:20px; font-size:12px;\">";
echo "<option value=\"\">請選擇職位小類</option>";
$category_num=count($category_list); 
for($i=0;$i<$category_num;$i++)
{
echo "<option value=".$category_list[$i]['id'].">".$category_list[$i]['categoryname']."</option>";
}
echo "</select>";
}
else
{
echo "<select name=\"subclass\" style=\"width:210px; height:20px; font-size:12px;\" disabled=\"disabled\">";
echo "<option value=\"\">請選擇職位小類</option>";
echo "</select>";
}
}
?>
